<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">

        <input type="button" value="确定" id="btn">

    </div>
</body>
<script>

var app = document.getElementById('app');
app.addEventListener('click',appfunction)

var btn = document.getElementById('btn');
btn.addEventListener('click',btnfunction)

function appfunction(params) {
    alert('app');
}

function btnfunction(event) {
    console.log(event.type);    //事件的类型
    console.log(event.target);  //事件的标签HTML元素
    event.stopPropagation();       //阻止事件冒泡  上层的事件禁止执行
    event.preventDefault();     //阻止默认事件
    
    alert('btn');
}

</script>
</html>